//搜索按钮相关功能
function search() {
    let input = document.querySelector("#input_search").value;
    if (input == "") {
        renderTable(getItem("tableList"));
    }

    let tableList = getItem("tableList");
    let reg = new RegExp(input);
    let searchList = {};
    for (let name in tableList) {
        if (name.match(reg)) {
            searchList[name] = tableList[name];
        }
    }

    renderTable(searchList);
}

document.querySelector("#btn_refresh").onclick = function(){
    search();
    layui.use("layer", function(){
        var layer = layui.layer;
        layer.msg("已刷新", {time: 500});
    });
}
